package com.usefullc.bootstrap.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.usefullc.system.controller.BaseController;
import com.usefullc.system.service.DataConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 模板页面针对 Thymeleaf
 * @author: Sampson
 * @date: 2022-01-10 15:28
 */
@Controller
@RequestMapping(path = "/tpl/")
@Api( tags="模板管理")
public class TplController extends BaseController {

    @Value("${usefullc.api.host}")
    private String apiHost;

    @Autowired
    private DataConfigService dataConfigService;


//    @ApiOperationSupport(author = "Sampson@usefullc.com")
//    @ApiOperation(value = "下载页面")
//    @GetMapping(path = "download/index.html")
//    public String download(DownloadParam param, ModelMap map) {
//        String platform = param.getPlatform();
//        String version = param.getVersion();
//        String stuff = "exe";
//        if(platform.contains("macos")){
//            stuff = "dmg";
//        }
////        String url = "https://video-1.usefullc.com/yt/2.3.0/YT-windows-x64-2.3.0.exe";
//        String url = "https://video-1.usefullc.com/yt/"+version+"/YT-"+platform+"-"+version+"."+stuff;
//        map.put("url",url);
//        return "download/index";
//    }

//    @ApiOperationSupport(author = "Sampson@usefullc.com")
//    @ApiOperation(value = "支付页面")
//    @RequestMapping(path = "pay/index.html",method= RequestMethod.GET)
//    public String pay( ModelMap map) {
////        map.put("tbQRUrl",apiHost+"/system/common/res/download/qr.png");
////        map.put("wxUrl",apiHost+"/system/common/res/download/wx.png");
////        DataConfig dataConfig = dataConfigService.findByCode(VideoConstants.PAY_GOODS_URL);
////        map.put("tbPayUrl",dataConfig.getValue());
//        return "pay/index.html";
//    }

}
